import 'dart:io';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_hotwork/SplashPage.dart';
import 'package:flutter_bmfbase/BaiduMap/bmfmap_base.dart'
    show BMFMapSDK, BMF_COORD_TYPE;
// 用于路由返回监听
 final RouteObserver<PageRoute> routeObserver = RouteObserver<PageRoute>();
void main() {
  // 强制竖屏
  SystemChrome.setPreferredOrientations([
    DeviceOrientation.portraitUp,
    DeviceOrientation.portraitDown
  ]);
  runApp(new MaterialApp(
      navigatorObservers: [routeObserver],
      title: "智慧热网管控系统",
      theme: new ThemeData(
        primaryIconTheme: const IconThemeData(color: Colors.white),
        brightness: Brightness.light,
        primaryColor: Color(0xFF2B85E4),
        accentColor: Color(0xFF2B85E4),
      ),
      home: new SplashPage()));
//  AMap.init('809e70ae365997eaeec69eb2215c8402');

  if(Platform.isIOS){
    BMFMapSDK.setApiKeyAndCoordType(
        'AATp1fIh3jcs3nUN4wglXGzG209ZQZap', BMF_COORD_TYPE.BD09LL);
  }else if(Platform.isAndroid){
// Android 目前不支持接口设置Apikey,
// 请在主工程的Manifest文件里设置，详细配置方法请参考[https://lbsyun.baidu.com/ 官网][https://lbsyun.baidu.com/)demo
    BMFMapSDK.setCoordType(BMF_COORD_TYPE.BD09LL);
  }
}
